//
//  DatePickerView.m
//  Trackit
//
//  Created by yaodaobin on 2017/6/30.
//  Copyright © 2017年 yaodaobin. All rights reserved.
//

#import "DatePickerView.h"

@implementation DatePickerView

- (id)initWithTitle:(NSString *)title delegate:(id /*<UIActionSheetDelegate>*/)delegate {
    self = [super init];
    if (self) {
        self.delegate = delegate;
        self.titleLabel.text = title;
        
        self.datePicker = [[UIDatePicker alloc] initWithFrame:CGRectMake(0.0f, 44, self.width, 216)];
        [self addSubview:self.datePicker];
        
        self.datePicker.datePickerMode = UIDatePickerModeDate;
    }
    return self;
}



- (void)setMinimumDate:(NSDate *)aMinimumDate {
    self.datePicker.minimumDate = aMinimumDate;
}

- (NSDate *)minimumDate {
    return self.datePicker.minimumDate;
}

- (void)setMaximumDate:(NSDate *)aMaximumDate {
    self.datePicker.maximumDate = aMaximumDate;
}

- (NSDate *)maximumDate {
    return self.datePicker.maximumDate;
}

- (void)setDate:(NSDate *)aDate {
    self.datePicker.date = aDate;
}

- (NSDate *)date {
    return self.datePicker.date;
}

- (void)setTitle:(NSString *)title {
    self.titleLabel.text = title;
}

- (NSString *)title {
    return self.titleLabel.text;
}
@end
